package com.kedou.sdk.params;

import com.kedou.sdk.utils.WL;

/**
 * Created by Administrator on 2017/6/14 0014.
 */

public final class GetRequestParams {
    private static final String TAG = GetRequestParams.class.getSimpleName();

    private static final String DEFAULET_SECRET = "86b070f9bcc5a83178fd4ed51ec7fd6b";

    final String service;

    final String ticket;

    private GetRequestParams(final Builder builder) {
        this.service = builder.service;
        this.ticket = builder.ticket;
    }

    public String toParamsString(String httpPrefix) {
        StringBuilder builder = new StringBuilder(httpPrefix);
        builder.append(service);
        builder.append("?token=").append(ticket);

        WL.d(TAG, "toParamsString : " + builder.toString());
        return builder.toString();
    }

    public static class Builder {
        private String service;

        private String ticket;

        public Builder() {

        }

        public Builder setService(String service){
            this.service = service;
            return this;
        }



        public Builder setTicket(String ticket) {
            this.ticket = ticket;
            return this;
        }

        public GetRequestParams build() {
            StringBuilder builder = new StringBuilder();
            builder.append("service=").append(service);

            builder.append("&ticket=").append(ticket);

            return new GetRequestParams(this);
        }

    }


}
